package com.classes.constants;

public enum ConstantsTypeEnum {

    UTF_8_INFO(1),
    INTEGER_INFO(3),
    FLOAT_INFO(4),
    LONG_INFO(5),
    DOUBLE_INFO(6),
    CLASS_INFO(7),
    STRING_INFO(8),
    FIELD_REF_INFO(9),
    METHOD_REF_INFO(10),
    INTERFACE_METHOD_REF_INFO(11),
    NAME_AND_TYPE_INFO(12),
    METHOD_HANDLE_INFO(15),
    METHOD_TYPE_INFO(16),
    INVOKE_DYNAMIC_INFO(18),;


    private int type;

    private ConstantsTypeEnum(int type) {
        this.type = type;
    }

    public static ConstantsTypeEnum getByType(int type) {
        for (ConstantsTypeEnum tp : ConstantsTypeEnum.values()) {
            if (tp.getType() == type) {
                return tp;
            }
        }
        return null;
    }


    public int getType() {
        return this.type;
    }


}
